UI: Prevent failure when loading network offerings when physical network has a tag#13503
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a UI runtime failure when listNetworkOfferings returns no networkoffering array (e.g., when a physical network tag filters out all offerings), by ensuring the component always works with an array before applying .filter().
Changes:
- Default
networkOfferingsto an empty array when the API response omitsnetworkoffering. - Prevents a TypeError during subsequent filtering, avoiding an incorrect error notification.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #13503 +/- ##
============================================
+ Coverage 17.66% 20.12% +2.45%
- Complexity 15793 19712 +3919
============================================
Files 5923 6235 +312
Lines 533309 614284 +80975
Branches 65237 88501 +23264
============================================
+ Hits 94229 123616 +29387
- Misses 428434 477751 +49317
- Partials 10646 12917 +2271
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 23.58% |
| Branch coverage | 17.77% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
|
Thanks @Pearl1594 can you please rebase it and target to branch 4.22? |
|
@kiranchavala a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
6dad495 to
a94b95d
Compare
|
rebased to 4.22 @nvazquez |
|
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 23.56% |
| Branch coverage | 17.79% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
|
verified ok |


Description
This PR fixes: #13485
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?